< previous page page_52 next page >

Page 52
Common Label Control Properties
As is the case with from forms, youll probably never change all the properties of a label control. Table 3.3 lists the properties youll change most often for the label control.
Control Arrays
You created a control array in the preceding exercise. A control array is a list of the same type of control, all of which share the same name. You created eight label controls, and each ones name is lblLabel. When you answer yes to the prompt to create a control array, Visual Basic automatically sets the Index property of each of these controls to a unique value. The Index property plus the name of the control is now how you will be able to distinguish one control from another.

Table 3.3 Common Label Properties.
PropertyDescription
AlignmentSet this property to have the text right, left, or centered within the label.
AutoSizeAfter adding the text to the Caption property of the label control, you may have to size it manually to get all the text to show. This property will automatically size the control to the height and width of the text thats placed in it.
BorderStyleDisplays a border around the label.
CaptionDisplays text inside of the label.
NameIdentifies the name of the control. The standard prefix when naming this type of control is lbl.
VisibleIndicates whether the control is visible.
WordWrapIf set to True, this property allows the caption to wrap to another line.

 
< previous page page_52 next page >

If you like this book, buy it!